package leetcode.code;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;
import leetcode.helper.MaxDebug;

public class Solution1446 implements IDebug {

	public int maxPower(String s) {
		char c = s.charAt(0);
		int max = 1;
		int count = 1;
		for (int i = 1; i < s.length(); i++) {
			char cur = s.charAt(i);
			if (cur == c) {
				count++;
			} else {
				c = cur;
				max = Math.max(max, count);
				count = 1;
			}
		}
		max = Math.max(max, count);
		return max;
	}

	@Override
	public void debug1() {
		HelpDebug.compare(2, this.maxPower("leetcode"));
	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub
		HelpDebug.compare(5, this.maxPower("abbcccddddeeeeedcba"));
	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub
		HelpDebug.compare(5, this.maxPower("triplepillooooow"));
	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub
		HelpDebug.compare(11, this.maxPower("hooraaaaaaaaaaay"));
	}

	public void debug5() {
		// TODO Auto-generated method stub
		HelpDebug.compare(1, this.maxPower("1"));
	}

	public static void main(String[] args) {
		Solution1446 so = new Solution1446();
		MaxDebug.debug14(so);
		so.debug5();

	}

}
